﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BtoBSWT315
{
    public partial class Default_PHB : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                PHB();
            }
        }

        private void PHB()
        {
            Admin.Admin_ClassDb classdb = new Admin.Admin_ClassDb();

            string sqldw = "select top 15 id,qymc,hits from Qyml order by hits desc,id asc";

            string sqlzs = "select top 15 info_id,showname,hits from info where type='代理' or type='合作' order by  hits desc, info_id asc";

            string sqlgy = "select top 15 info_id,showname,hits from info where type='供应' order by  hits desc,info_id asc";
            string sqlqg = "select top 15 info_id,showname,hits from info where type='采购' order by  hits desc, info_id asc";

            //企业排行榜
            dw.DataSource = classdb.GetTables(sqldw);
            dw.DataBind();
            


            //合作代理排行榜
            zs.DataSource = classdb.GetTables(sqlzs);
            zs.DataBind();
    

            //供应排行榜
            gy.DataSource = classdb.GetTables(sqlgy);
            gy.DataBind();
         

            //求购排行榜
            qg.DataSource = classdb.GetTables(sqlqg);
            qg.DataBind();
            classdb.CloseDataConnection();

            classdb.Dispose();
            
        }
    }
}